from db.db_base import BaseModel
from sqlalchemy import Column, String, Boolean


class SadminAuthUser(BaseModel):
    __tablename__ = "sadmin_auth_user"
    __table_args__ = ({'comment': '服务系统用户表'})

    telephone = Column(String(50), nullable=False, index=True, comment="手机号", unique=True)
    name = Column(String(50), index=True, nullable=False, comment="姓名")
    gender = Column(String(8), nullable=False, default="0", comment="性别, 0男1女")
    nickname = Column(String(50), nullable=True, comment="昵称")
    is_active = Column(Boolean, default=True, comment="是否可用")
    is_cancel = Column(Boolean, default=False, comment="是否注销")
    wechat = Column(String(50), nullable=True, comment="微信")
    qq = Column(String(50), nullable=True, comment="QQ")
    avatar = Column(String(500), comment='头像')

    def __repr__(self):
        return self.name


